<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>新增新闻表</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css" media="all">
    <link href="/lib/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet"/>
    <link href="/lib/winui/css/winui.css" rel="stylesheet"/>

    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
    <style type="text/css">
        .layui-input-block {
            margin-left: 110px;
            min-height: 36px;
            padding-right: 15px;
        }

        .layui-form-selected dl{
            z-index:10000;
        }
    </style>
</head>

<body>
<div style="margin-top: 20px;">

</div>
<form class="layui-form" action="/newsController/save">

    <div class="layui-form-item">
        <label class="layui-form-label">新闻标题</label>
        <div class="layui-input-block">

            <input id="newsTitle" lay-vertype="tips" lay-verify="newsTitle"
                   name="newsTitle"
                   class="layui-input"
                   type="text">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">所在栏目</label>
        <div class="layui-input-block">

        <#--<input id="categoryId" lay-vertype="tips" lay-verify="categoryId"-->
        <#--name="categoryId"-->
        <#--class="layui-input"-->
        <#--type="text">-->
            <select id="categoryId" lay-vertype="tips" lay-verify="categoryId"
                    name="category.categoryId" lay-search>
                <option value=""></option>
            <#list categories as cate>
                <option value="${cate.categoryId}">${cate.categoryName}</option>
            </#list>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">标题图片</label>
        <div class="layui-input-block">

            <input id="newsPic" lay-vertype="tips" lay-verify="newsPic"
                   name="newsPic"
                   class="layui-input layui-hide"
                   type="text">

            <div class="layui-upload">
                <button type="button" class="layui-btn" id="accPhoto">上传图片</button>
                <div class="layui-upload-list" style="padding-left: 0px;">
                    <img class="layui-upload-img" id="accPhotoimg" width="109" height="112" src="/css/zanwutupian.jpg">
                    <p id="accPhoto"></p>
                </div>
            </div>
        </div>


    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">新闻摘要</label>
        <div class="layui-input-block">

            <input id="newsSummary" lay-vertype="tips" lay-verify="newsSummary"
                   name="newsSummary"
                   class="layui-input"
                   type="text">
        </div>
    </div>


    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">新闻内容</label>
        <div class="layui-input-block">
            <#--<textarea id="newsContent" lay-vertype="tips" lay-verify="newsContent"-->
                      <#--placeholder="请输入内容" name="newsContent" class="layui-textarea"></textarea>-->


            <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
        </div>
    </div>


<#--<div class="layui-form-item">-->
<#--<label class="layui-form-label">发布时间</label>-->
<#--<div class="layui-input-block">-->
<#--<input id="newsPublishtime" lay-vertype="tips" required-->
<#--lay-verify="required" lay-verify="newsPublishtime" name="newsPublishtime"-->
<#--class="layui-input"-->
<#--type="text" lay-verify="date" placeholder="yyyy-MM-dd">-->
<#--</div>-->
<#--</div>-->


    <div class="layui-form-item layui-hide">
        <label class="layui-form-label">浏览次数</label>
        <div class="layui-input-block">

            <input id="newsReadingnumber" lay-vertype="tips" lay-verify="newsReadingnumber"
                   name="newsReadingnumber"
                   class="layui-input"
                   type="text">
        </div>
    </div>


    <div class="layui-form-item layui-hide">
        <label class="layui-form-label">评论条数</label>
        <div class="layui-input-block">

            <input id="newsCommentcount" lay-vertype="tips" lay-verify="newsCommentcount"
                   name="newsCommentcount"
                   class="layui-input"
                   type="text">
        </div>
    </div>


    <div class="layui-form-item layui-hide">
        <label class="layui-form-label">发布文章的用户ID</label>
        <div class="layui-input-block">

            <input id="userId" lay-vertype="tips" lay-verify="userId"
                   name="tcommaccount.accId"
                   class="layui-input"
                   type="text">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">显示顺序</label>
        <div class="layui-input-block">

            <input id="newsSort" lay-vertype="tips" lay-verify="newsSort|number"
                   name="newsSort"
                   class="layui-input"
                   type="text" value="0">
        </div>
    </div>


<#--<div class="layui-form-item">-->
<#--<label class="layui-form-label">更新时间</label>-->
<#--<div class="layui-input-block">-->
<#--<input id="updateTime" lay-vertype="tips" required-->
<#--lay-verify="required" lay-verify="updateTime" name="updateTime"-->
<#--class="layui-input"-->
<#--type="text" lay-verify="date" placeholder="yyyy-MM-dd">-->
<#--</div>-->
<#--</div>-->


    <div class="layui-input-block" style="text-align: center;margin: 0px;padding: 0px;">
        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
        <button id="retBtn" type="reset" class="layui-btn layui-btn-primary"　>重置</button>
        <input type="reset" class="layui-btn layui-btn-primary layui-hide" id="resetInput" 　/>
    </div>
</form>
<script>
    var ue = UE.getEditor('editor');
    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function(action){
        if(action == '/uploadController/ueUpload'){
            return '/uploadController/ueUpload';
        }else{
            return this._bkGetActionUrl.call(this, action);
        }
    }
</script>
<script src="/lib/layui/layui.js"></script>
<script src="/js/news/add.js"></script>
</body>

</html>
